package com.sservice.service.service;

import com.sservice.model.entity.PurchaseOrderBill;
import com.sservice.model.vo.PurchaseOrderBillVo;

import java.math.BigDecimal;
import java.util.List;

public interface PurchaseOrderBillService {
    int deleteByPrimaryKey(Integer id);

    int insert(PurchaseOrderBill record);

    int insertSelective(PurchaseOrderBill record);

    /**
     * 收货开单
     *
     * @param record
     * @return
     */
    Object createBill(PurchaseOrderBill record);

    /***
     *  订单合并收货
     * @param record
     * @return
     */
    Object createBillByCombineOrder(PurchaseOrderBillVo record);

    /**
     *  申请付款，no 必须
     * @param record
     * @return
     */
    Object applyPaper(PurchaseOrderBillVo record);

//    Object multiOrderToBill(PurchaseOrderBill record);

    PurchaseOrderBill selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(PurchaseOrderBill record);

    /**
     *  审核拒绝
     * @param record
     * @return
     */
    Object refuse(PurchaseOrderBillVo record);
    /**
     * 入库
     *
     * @param record
     * @return
     */
    Object instore(PurchaseOrderBill record);
    Object instoreCombine(PurchaseOrderBillVo record);

    /**
     * 清空实体数
     *
     * @param record
     * @return
     */
    Object clear(PurchaseOrderBill record);
    Object clearCombine(PurchaseOrderBill record);

    /**
     * 删除车号形式收货单
     *
     * @param record
     * @return isAuthed : 如果收货单录入与实提数量，是否有权限删除
     */
    Object delete(PurchaseOrderBill record, Boolean isAuthed);

    /**
     * 删除合并收货
     * @param record
     * @param isAuthed
     * @return
     */
    Object deleteCombine(PurchaseOrderBill record, Boolean isAuthed);

    int updateByPrimaryKey(PurchaseOrderBill record);

    int queryCount(PurchaseOrderBillVo record);

    List<PurchaseOrderBillVo> queryByPage(PurchaseOrderBillVo record);

    int queryCurrentDayCount();

    /***
     *  收货单数量变更
     * @param id
     * @param actual 实收数量
     * @param sended 已发货数量
     * @param sending 发货中数量
     * @param  status 发货单状态
     * @return
     */
    PurchaseOrderBill changeNumber(Integer id, BigDecimal actual, BigDecimal sended, BigDecimal sending, String status);

}